import {Account} from '@/base/model/Account';
import {getAccount, putAccountPwd, putAccountUserPwd} from '@/base/api/AccountApi';
import {AccountPwd} from '@/base/model/AccountPwd';

export class ChangeAccountPwdBloc {
  form = new AccountPwd()

  save(id: number) {
    const entity = {
      id,
      password: this.form.password
    };
    return putAccountUserPwd(entity)
  }

  oldSave() {
    const entity = {
      oldPwd: this.form.oldPwd,
      password: this.form.password
    };
    // @ts-ignore
    return putAccountPwd(entity)
  }
}
